<?php

class FlashSWF {
	public $swf;
	public $name;
	public $width;
	public $height;
	public $color = "#FFFFFF";
	public $FPVersion = "8";
	public $quality = "best";
	public $scale = "noscale";
	public $align = "middle";
	public $menu = "false";
	public $loop = "false";
	public $allowFullScreen = "true";
	public $allowScriptAccess = "never";
	private $objetString = false;
	
	public function answer($queryString){
		echo $queryString;
	}
	
	public function getSWFObject($swf, $name, $width, $height, $FPVersion = null, $color = null, $quality = null, $scale = null, $align = null, $menu = null, $loop = null, $allowFullScreen = null, $allowScriptAccess = null) {
		$this->swf 					= $swf;
		$this->name 				= $name;
		$this->width 				= $width;
		$this->height 				= $height;
		$this->color 				= ($color != null)?				$color:					$this->color;
		$this->FPVersion 			= ($FPVersion != null)?			$FPVersion:				$this->FPVersion;
		$this->quality 				= ($quality != null)?			$quality:				$this->quality;
		$this->scale 				= ($scale != null)?				$scale:					$this->scale;
		$this->align 				= ($align != null)?				$align:					$this->align;
		$this->menu 				= ($menu != null)?				$menu:					$this->menu;
		$this->loop 				= ($loop != null)?				$loop:					$this->loop;
		$this->allowFullScreen 		= ($allowFullScreen != null)?	$allowFullScreen:		$this->allowFullScreen;
		$this->llowScriptAccess 	= ($llowScriptAccess != null)?	$llowScriptAccess:		$this->llowScriptAccess;
		
		$this->objetString = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='.$this->FPVersion.'" width="'.$this->width.'" height="'.$this->height.'" id="'.$this->name.'" align="'.$this->align.'">';
		$this->objetString .='<param name="allowScriptAccess" value="'.$this->allowScriptAccess.'" />';
		$this->objetString .='<param name="allowFullScreen" value="'.$this->allowFullScreen.'" />';
		$this->objetString .='<param name="movie" value="'.$this->swf.'" /><param name="loop" value="'.$this->loop.'" /><param name="menu" value="'.$this->menu.'" /><param name="quality" value="'.$this->quality.'" /><param name="scale" value="'.$this->scale.'" /><param name="bgcolor" value="'.$this->color.'" />';
		$this->objetString .='<embed src="'.$this->swf.'" loop="'.$this->loop.'" menu="'.$this->menu.'" quality="'.$this->quality.'" scale="'.$this->scale.'" bgcolor="'.$this->color.'" width="'.$this->width.'" height="'.$this->height.'" name="'.$this->name.'" align="'.$this->align.'" allowScriptAccess="'.$this->allowScriptAccess.'" allowFullScreen="'.$this->allowFullScreen.'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		$this->objetString .='</object>';
		return $this->objetString;
	}
	
	public function getObjetString(){
		return $this->objetString;
	}
}

?>
